Eventsvoid onActivate ()
An event-handler callback function, called when the element acquires the keyboard focus.
Called when the user gives the control the keyboard focus by clicking it or tabbing into it.
void onChange ()
An event-handler callback function, called when the content of the element has been changed
void onDeactivate ()
An event-handler callback function, called when the element loses the keyboard focus.
Called when the user moves the keyboard focus from the previously active control to another control.
void onDoubleClick ()
An event-handler callback function, called when an item in the listbox is double-clicked
Check the selection property to identify the item that was double-clicked.
void onDraw ()
An event-handler callback function, called when the window is about to be drawn.
Allows the script to modify or control the appearance, using the control's associated ScriptUIGraphics object. Handler takes one argument, a DrawState object.
void onShortcutKey ()
An event-handler callback function, called when the element's shortcutKey sequence is typed in the active window.
In Windows only.
InstancesListItem add (type:
String[, text:
String])
Adds an item to the choices in this list.
Returns the item control object. If this is a multi-column list box, each added ListItem represents one selectable row. Its text and image values specify the label in the first column, and the subitems property specifies the labels in the additional columns.
Parameter | Type | Description |
type | String | The type of the child element, the string "item". |
text | String | The localizable text label for the item. (Optional) |
Boolean addEventListener (eventName:
String, handler:
Function[, capturePhase:
Boolean=false])
Registers an event handler for a particular type of event occuring in this element.
Parameter | Type | Description |
eventName | String | The name of the event.
Event names are listed in the JavaScript Tools Guide.
|
handler | Function | The function that handles the event.
This can be the name of a function defined in the extension, or a locally defined handler function to be executed when the event occurs. A handler function takes one argument, the UIEvent object.
|
capturePhase | Boolean | When true, the handler is called only in the capturing phase of the event propagation. (default: false) Default is false, meaning that the handler is called in the bubbling phase if this object is an ancestor of the target, or in the at-target phase if this object is itself the target. |
Event dispatchEvent ()
Simulates the occurrence of an event in this target.
A script can create a UIEvent object for a specific event and pass it to this method to start the event propagation for the event.
ListItem find (text:
String)
Retrieves an item object from the list that has a given text label.
Parameter | Type | Description |
text | String | The text string to match. |
void hide ()
Hides this element.
void notify ([eventName:
String])
Sends a notification message, simulating the specified user interaction event.
Parameter | Type | Description |
eventName | String | The name of the control event handler to call.
One of: onClick, onChange, onChanging. By default, simulates the onChange event for an edittext control, an onClick event for controls that support that event.
(Optional) |
void remove (what:
Any)
Removes a child item from the list.
Parameter | Type | Description |
what | Any |
The item or child to remove, specified by 0-based index, text value, or as a ListItem object.
|
void removeAll ()
Removes all child items from the list.
Boolean removeEventListener (eventName:
String, handler:
Function[, capturePhase:
Boolean=false])
Unregisters an event handler for a particular type of event occuring in this element.
All arguments must be identical to those that were used to register the event handler.
Parameter | Type | Description |
eventName | String | The name of the event. |
handler | Function | The function that handles the event. |
capturePhase | Boolean | Whether to call the handler only in the capturing phase of the event propagation. (default: false) |
void show ()
Shows this element.
When a window or container is hidden, its children are also hidden, but when it is shown again, the children retain their own visibility states.
|